package cn.kgc.service.impl;

import cn.kgc.bean.pojo.CCase;
import cn.kgc.bean.pojo.CUser;
import cn.kgc.mapper.CaseMapper;
import cn.kgc.mapper.UserMapper;
import cn.kgc.service.CaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class CaseServiceImpl extends ServiceImpl<CaseMapper, CCase> implements CaseService {
    @Resource
    private CaseMapper caseMapper;

    @Override
    public CCase getCaseByid(Integer id) {
        return caseMapper.getCaseByid(id);
    }

    @Override
    public CCase getAllInfo(Integer courtId) {
        QueryWrapper<CCase> wrapper = new QueryWrapper<>();
        wrapper.eq("court",courtId);
        CCase cCase = caseMapper.selectOne(wrapper);
        return cCase;
    }

    @Override
    public int addCaseInfo(CCase cCase) {
        return caseMapper.addCaseInfo(cCase);
    }

    @Override
    public int updateStatus1(Integer id) {
        return caseMapper.updateStatus1(id);
    }

    @Override
    public int updateStatus2(Integer id) {
        return caseMapper.updateStatus2(id);
    }
}
